/**
*依赖于小程序wx环境
*/
const logService = require('../services/LogService');
/**
*behavior:用户行为，error_descrip:错误描述
*/
function error(behavior,error_descrip){
  wx.getSystemInfo({success:function(res){
    var sysInfo = JSON.stringify(res);
    var user = wx.getStorageSync('user');
    var openid = user.openid;
    var data = {
      mobile_info:sysInfo,
      openid:openid,
      project_type:4,
      behavior:behavior,
      error_descrip:error_descrip
    }
    logService.error(data);
  }});
}

module.exports = {
  error: error
}
